using System;

namespace SmartMathLibrary
{
    /// <summary>
    /// Interface to implement a ComplexNumber class.
    /// </summary>
    public interface IComplexNumber
    {
        /// <summary>
        /// Gets or sets the real number part.
        /// </summary>
        /// <value>The real number part.</value>
        double RealNumberPart { get; set; }

        /// <summary>
        /// Gets or sets the imaginary number part.
        /// </summary>
        /// <value>The imaginary number part.</value>
        double ImaginaryNumberPart { get; set; }

        /// <summary>
        /// Calculates the modulus of the complex number in polar form.
        /// </summary>
        /// <returns>The modulus of the complex number in polar form.</returns>
        Double PolarFormModulus { get; }

        /// <summary>
        /// Calculates the angle in degrees for the complex number in polar form.
        /// </summary>
        /// <returns>The angle in degrees for the complex number in polar form.</returns>
        Double PolarFormAngle { get; }

        /// <summary>
        /// Gets the argument of the complex number.
        /// </summary>
        /// <value>The argument of the complex number.</value>
        double Argument { get; }

        /// <summary>
        /// Inverts the sign of the imaginary number part.
        /// </summary>
        void InvertImaginaryNumberPart();

        /// <summary>
        /// Inverts the sign of the real number part.
        /// </summary>
        void InvertRealNumberPart();

        /// <summary>
        /// Inverts the sign of the realnumber and imaginary number part.
        /// </summary>
        void Invert();

        /// <summary>
        /// Calculates the inverse of the current complex number.
        /// </summary>
        /// <returns>The inverse of the current complex number.</returns>
        ComplexNumber CalculateInverse();

        /// <summary>
        /// Powers the current complex number raised to the specified power.
        /// </summary>
        /// <param name="n">A number that specifies a power.</param>
        void Pow(double n);

        /// <summary>
        /// Transforms a complex number from the polar form to the cartesian form(a + bi).
        /// </summary>
        /// <param name="r">The modulus of the number, normally r.</param>
        /// <param name="phi">The angle of the complex number, normally phi.</param>
        /// <returns>The complex number in cartesian form.</returns>
        ComplexNumber PolarToCartesian(double r, double phi);

        /// <summary>
        /// Copies the current instance.
        /// </summary>
        /// <returns>A copy of the current instance.</returns>
        ComplexNumber Copy();
    }
}